﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TopicSchedule.ascx.cs" Inherits="Lenovo.CFI.Web.VP.TopicSchedule" %>
<tbwc:StyleSheetControl ID="SscList" runat="server" CssPath="list.css"></tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SccDialogs" runat="server" CssPath="modaldialogs.css"></tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SscDp" runat="server" CssPath="DatePicker/datepicker.css"></tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SscThis" runat="server" CssPath="VP/topic/topicschedule.css"></tbwc:StyleSheetControl>
<ajaxToolkit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" CombineScripts="false" ID="ScriptManager1" />

<div class="wrapper">
    <tbwc:Fieldset ID="FsSet" runat="server" DesignWidth="1240px" CssClass="idea" GroupingText=" ">
        <div class="line"><asp:Label ID="LblReviewTime" runat="server" AssociatedControlID="DpReviewDate" Text="Date and Time:" CssClass="title"></asp:Label><tbwc:DatePicker 
            ID="DpReviewDate" runat="server" Width="8.5em" /><asp:TextBox 
            ID="TxtTimeAm" runat="server" Text="10:00" Width="6em"></asp:TextBox>(AM)<asp:RegularExpressionValidator
            ID="RevTimeAm" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtTimeAm" 
                ValidationExpression="\d{2}:\d{2}" Display="Dynamic"></asp:RegularExpressionValidator><asp:TextBox
            ID="TxtTimePm" runat="server" Text="13:30" Width="6em"></asp:TextBox>(PM)<asp:RegularExpressionValidator
            ID="RevTimePm" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtTimePm" 
                ValidationExpression="\d{2}:\d{2}" Display="Dynamic"></asp:RegularExpressionValidator></div>
    </tbwc:Fieldset> 
    <div class="operation" style="padding:8px 0px 8px 16em"><asp:Button 
        ID="BtnGenerate" runat="server" CssClass="primary" Text="Generate Schedule" OnClick="BtnGenerate_Click" /></div>
   
</div>

<asp:UpdatePanel ID="UpList" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div id="relatedoperation">
            <div style="float:right" class="operation"><asp:Button ID="BtnAdd" runat="server" 
                    SkinID="EditPrimary" Text="Add Idea" ToolTip="Add Idea" onclick="BtnAdd_Click"/></div>
        </div>
        <div class="dataListArea">
                <tbwc:GridViewEx ID="GvList" runat="server" SkinID="List" DataKeyNames="ID,EventType"
                    AllowPaging="false" OnRowCommand="GvList_RowCommand" OnRowDataBound="GvList_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="No.">
                            <ItemStyle CssClass="listNo" />
                            <ItemTemplate><asp:Literal ID="LtrNo" runat="server"></asp:Literal></ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="StartTime">
                            <ItemTemplate><asp:Literal ID="LtrStart" runat="server"></asp:Literal></ItemTemplate>
                            <ItemStyle CssClass="time" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Period">
                            <ItemTemplate><asp:TextBox ID="TxtPeriod" Width="3em" runat="server" Text='<%# Eval("Period") %>'></asp:TextBox>min</ItemTemplate>
                            <ItemStyle CssClass="period" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Sort">
                            <ItemTemplate><asp:TextBox ID="TxtSort" Width="2em" runat="server" Text='<%# Eval("Sort")%>'></asp:TextBox>
                                <asp:ImageButton ID="BtnUp" runat="server" CommandName="MoveUp" SkinID="ListUp" Text="up"></asp:ImageButton>
                                <asp:ImageButton ID="BtnDown" runat="server" CommandName="MoveDown" SkinID="ListDown" Text="down"></asp:ImageButton></ItemTemplate>
                            <ItemStyle CssClass="sort" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Idea">
                            <ItemTemplate><asp:Literal ID="LtrIdea" runat="server"></asp:Literal></ItemTemplate>
                            <ItemStyle CssClass="title" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Author">
                            <ItemTemplate><asp:Literal ID="LtrOwner" runat="server"></asp:Literal></ItemTemplate>
                            <ItemStyle CssClass="owner" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText=" ">
                            <ItemTemplate>
                                <asp:ImageButton ID="BtnBreak" runat="server" CausesValidation="False" CommandName="InsertBreak" 
                                    SkinID="ListInsert"></asp:ImageButton>
                                <tbwc:ConfirmImageButton ID="BtnDel" runat="server" CausesValidation="False" CommandName="Remove"
                                    ConfirmText="Delete?" SkinID="ListDelete" CommandArgument='<%# Eval("ID")%>' /></ItemTemplate>
                            <ItemStyle CssClass="listOp" />
                        </asp:TemplateField>
                    </Columns>
                </tbwc:GridViewEx>
        </div>

        <asp:Button ID="BtnHiddenEdit" runat="Server" Style="display: none" />
        <ajaxToolKit:ModalPopupExtender ID="MpeAddBreak" runat="server" TargetControlID="BtnHiddenEdit"
            PopupControlID="PnlAddBreak" CancelControlID="BtnCancelAddBreak" BackgroundCssClass="modalBackground"
            PopupDragHandleControlID="PnlAddBreakCaption" Drag="false">
        </ajaxToolKit:ModalPopupExtender>
        <asp:Panel ID="PnlAddBreak" runat="server" CssClass="modalBox detail" Style="display: none;" Width="380px">
            <asp:Panel ID="PnlAddBreakCaption" runat="server" CssClass="caption" Style="margin-bottom: 10px;cursor: hand;">
                New Break</asp:Panel>
            
            <div><asp:Label ID="LblPeriod" runat="server" AssociatedControlID="TxtPeriod" Text="Period:" CssClass="title"></asp:Label><asp:TextBox 
	            ID="TxtPeriod" runat="server" Width="10em" MaxLength="20"></asp:TextBox><asp:CompareValidator
                ID="CvPeriod" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtPeriod" 
                    Type="Integer" Operator="DataTypeCheck" Display="Dynamic" ValidationGroup="Add"></asp:CompareValidator></div>
            <div><asp:Label ID="LblUntil" runat="server" AssociatedControlID="TxtUntil" Text="Until:" CssClass="title"></asp:Label><asp:TextBox 
	            ID="TxtUntil" runat="server" Width="10em" MaxLength="20"></asp:TextBox><asp:RegularExpressionValidator
                ID="RevUntil" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtUntil" 
                    ValidationExpression="\d{2}:\d{2}" Display="Dynamic" ValidationGroup="Add"></asp:RegularExpressionValidator></div>

            <div style="white-space: nowrap; text-align: center; margin-top:2em;">
		        <asp:Button ID="BtnSaveAddBreak" runat="server" Text="Save" OnClick="BtnSaveAddBreak_Click" CausesValidation="true" ValidationGroup="Add"/>
		        <asp:Button ID="BtnCancelAddBreak" runat="server" CausesValidation="false" Text="Cancel"/>
	        </div>

        </asp:Panel>

        <asp:Button ID="BtnHiddenAdd" runat="Server" Style="display: none" />
        <ajaxToolKit:ModalPopupExtender ID="MpeAddIdea" runat="server" TargetControlID="BtnHiddenAdd"
            PopupControlID="PnlAddIdea" CancelControlID="BtnCancelAddIdea" BackgroundCssClass="modalBackground"
            PopupDragHandleControlID="PnlAddIdeaCaption" Drag="false">
        </ajaxToolKit:ModalPopupExtender>
        <asp:Panel ID="PnlAddIdea" runat="server" CssClass="modalBox detail" Style="display: none;" Width="380px">
            <asp:Panel ID="PnlAddIdeaCaption" runat="server" CssClass="caption" Style="margin-bottom: 10px;cursor: hand;">
                Add Idea</asp:Panel>
         
            <div><asp:Label ID="LblIdeaAdd" runat="server" AssociatedControlID="DdlIdeaAdd" Text="Idea:" CssClass="title"></asp:Label><asp:DropDownList
                    ID="DdlIdeaAdd" runat="server" Width="25em"></asp:DropDownList></div>
            
            <div><asp:Label ID="LblPeriodAdd" runat="server" AssociatedControlID="TxtPeriodAdd" Text="Period:" CssClass="title"></asp:Label><asp:TextBox 
	            ID="TxtPeriodAdd" runat="server" Width="10em" MaxLength="20"></asp:TextBox><asp:CompareValidator
                ID="CvPeriodAdd" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtPeriodAdd" 
                    Type="Integer" Operator="DataTypeCheck" Display="Dynamic" ValidationGroup="AddIdea"></asp:CompareValidator></div>
            <div><asp:Label ID="LblSortAdd" runat="server" AssociatedControlID="TxtSortAdd" Text="Sort:" CssClass="title"></asp:Label><asp:TextBox 
	            ID="TxtSortAdd" runat="server" Width="10em" MaxLength="20"></asp:TextBox><asp:CompareValidator
                ID="CvSortAdd" runat="server" ErrorMessage="Invalid" ControlToValidate="TxtSortAdd" 
                    Type="Integer" Operator="DataTypeCheck" Display="Dynamic" ValidationGroup="AddIdea"></asp:CompareValidator></div>

            <div style="white-space: nowrap; text-align: center; margin-top:2em;">
		        <asp:Button ID="BtnSaveAddIdea" runat="server" Text="Save" OnClick="BtnSaveAddIdea_Click" CausesValidation="true" ValidationGroup="AddIdea"/>
		        <asp:Button ID="BtnCancelAddIdea" runat="server" CausesValidation="false" Text="Cancel"/>
	        </div>

        </asp:Panel>


        <div class="operation" style="padding: 8px 0px; text-align: center;"><asp:Button 
            ID="BtnSaveAll" runat="server" CssClass="primary" Text="SaveAll" OnClick="BtnSaveAll_Click" /><asp:LinkButton
            ID="BtnFinish" runat="server" Text="Finish" SkinID="EditSecondary" OnClick="BtnFinish_Click"></asp:LinkButton></div>

    </ContentTemplate>
</asp:UpdatePanel>



